﻿using SvgViewer.Core;
using SvgViewer.Utilities;
using System.Collections.Generic;
using System.Windows.Media;

namespace SvgViewer.ViewModel;

/// <summary>
/// 设置视图 ViewModel
/// </summary>
public class SettingsViewModel : ViewModelBase
{
    /// <summary>
    /// 主色调颜色列表
    /// </summary>
    public  IReadOnlyList<Color> Colors => BackgroundManager.Instance.BackgroundColors;

    /// <summary>
    /// 获取或设置当前所用语言
    /// </summary>
    public int Language {
        get=>Properties.Settings.Default.Language;
        set {
            Properties.Settings.Default.Language = value;
            Properties.Settings.Default.Save();
            LanguageManager.Instance.ChangeLanguage((Languages)value);
        }
    }

    /// <summary>
    /// 获取或设置当前使用的主色调索引
    /// </summary>
    public int ColorIndex {
        get => ThemeManager.Instance.ColorIndex;
        set => ThemeManager.Instance.ColorIndex = value;
    }
}